<!--检测首页-->
<template>
	<view>
		<view class="filter-conditions">
			<view class="forms-view">
				<uni-forms>
					<uni-forms-item label="年份" :label-width="60" name="content">
						<hpy-form-select  v-model="formData.year" class="select-item"
								mode="selector" title="请选择年份" @change="yearSelectChange"
								:dataList="yearsList"></hpy-form-select>
					</uni-forms-item>
					<uni-forms-item label="季度" :label-width="60" name="content">
						<hpy-form-select  v-model="formData.quarter" class="select-item"
								mode="selector" title="请选择季度" @change="quarterSelectChange"
								:dataList="quarterList"></hpy-form-select>
					</uni-forms-item>
				</uni-forms>
			</view>
		<view class="confirm-button">
				<button type="primary" class="mini-btn" @tap="confirmSubmit">确定</button>
		</view>	
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from "vue"
	const yearsList = ref([{value:"2022",text:"2022"},{value:"2023",text:"2023"},{value:"2024",text:"2024"},{value:"2025",text:"2025"}])
	const quarterList = ref([{value:"1",text:"第一季度"},{value:"2",text:"第二季度"},{value:"3",text:"第三季度"},{value:"4",text:"第四季度"},{value:"5",text:"上半年"},{value:"6",text:"下半年"}])
	const formData = ref({
		year: '',
		quarter:''
	})
	const doHandleYear = () => {
    var myDate = new Date();
    var tYear = myDate.getFullYear();
	console.log("yyyyyy",tYear);
     return tYear;
     }
	const yearSelectChange =(e) =>{
		formData.value.year = e.value.value;
	}
	const quarterSelectChange =(e) =>{
		formData.value.quarter = e.value.value;
	}
	const confirmSubmit = () =>{
		//console.log("11111",formData.value.year);
		//console.log("22222",formData.value.quarter);
		//console.log("user",uni.getStorageSync("user"));
		//console.log("进入检测任务列表页");
		console.log("eeeeeee",doHandleYear);
		let info = {
			year:formData.value.year,
			season:formData.value.quarter,
			userId:uni.getStorageSync("user").userId
		}
		uni.navigateTo({
					   url: '/pages/testing/testTaskList?info='+ encodeURIComponent(JSON.stringify(info))
					});
	}
</script>

<style scoped lang="scss">
	.filter-conditions{
		width: 750rpx;
		padding-top:50%;
		padding-left:10%;
		padding-right:10%;
		.operation-button{
			width:200rpx;
			height:80rpx;
			background-color: #455bdf;
			text-align: center;
			line-height: 80rpx;
			color:#ffffff;
			margin-bottom: 40rpx;
			border-radius: 10rpx;
		}	
		.forms-view{
			width:600rpx;
			.select-item{
				height:80rpx;
			}
		}
	}
	.uni-forms-item__label{
		font-size: 16px;
	}
	.confirm-button {
		position: fixed;
		bottom: 10rpx;
		left: 0;
		width: 100%;
		padding: 25rpx 82rpx;
		background: white;
		z-index: 2;
		box-sizing: border-box;
		padding: 20rpx 30rpx;
		background: rgba(255, 255, 255, 0.6);
	    
		uni-button {
			line-height: 80rpx !important;
			font-size: 26rpx;
		}
	}
</style>